import java.io.File;
import java.io.IOException;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Hua YY
 * Date: 2024-10-01
 * Time: 19:28
 */
public class IO1 {
    public static void main(String[] args) throws IOException {
        //File f = new File("C:/User/1/test.txt");//绝对路径
        File f = new File("./test.txt");
        System.out.println(f.exists());//判断文件目录是否存在
        System.out.println(f.getParent());//返回父目录文件路径
        System.out.println(f.getName());//返回file对象的名称
        System.out.println(f.getPath());//返回file对象的文件路径
        System.out.println(f.getAbsolutePath());//返回绝对路径
        System.out.println(f.getCanonicalPath());//返回对象修饰过后的路径canonical规范的
    }

}
